﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HippoMapper.SqlMapper
{
    public class SqlMapperParameter : IConditionSqlParameter
    {
        private string _expression;

        private List<SqlParameter> _parameters = new List<SqlParameter>();

        #region IParameter 成员

        public string Expression
        {
            get
            {
                return _expression;
            }
            set
            {
                _expression = value;
            }
        }

        public void AddParameter(string parameterName, System.Data.DbType type, object value)
        {
            SqlParameter parameter = new SqlParameter()
            {
                ParameterName = parameterName,
                Type = type,
                Value = value
            };

            _parameters.Add(parameter);
        }

        public IEnumerable<SqlParameter> Parameters
        {
            get { return _parameters; }
        }

        #endregion
    }
}
